package com.hmo.api;

/**
 * 枚举了一些常用API操作码
 * Created by macro on 2019/4/19.
 */
public enum ResultCode implements IErrorCode {
    SUCCESS("200", "成功"),
    PARAM("400", "参数错误"),
    PARAM_NOT_NULL("401", "参数不为空"),
    REQUEST_METHOD("402", "请求方法错误"),
    SERVER("500", "后台报错"),
    INSUFFICIENT_AUTHORITY("600", "权限不足"),
    USER_NOT_FIND("700", "用户不存在"),
    NOT_LOGIN("10000", "未登录"),
    TOKEN_INVALID("10001", "token无效"),
    TOKEN_EXPIRED("10002", "token过期"),
    LOGIN_EXPIRED("10010", "登陆已过期"),
    SIGNATURE("10020", "签名错误"),
    ILLEGAL_REQUEST("10030", "非法请求"),
    VERIFICATION_CODE_FREQUENTLY("10040", "发送验证码频繁"),
    VERIFICATION_CODE_OUT_LIMIT("10041", "验证码超出限制");
    private String code;
    private String message;

    private ResultCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
